
<%@ page import="com.msb.entity.Cpi" %>
<%@ page import="java.util.List" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>查看数据库表单</title>
	<script type="text/javascript">
		function _submit1(){
			var form = document.getElementById("form1");
			form.action="Dodelete"
			var input = document.getElementById("in1");
			input.type="submit";
		}

	</script>
	<script type="text/javascript">
		function _submit2() {


			var form = document.getElementById("form1");
			form.action = "Doupdate"
			var input = document.getElementById("in2");
			input.type = "submit";
		}
	</script>
<%--	全选函数--%>
	<script type="text/javascript">
		function chexkAll() {
			var byName = document.getElementsByClassName("cb");
			for(var i in byName){
				byName[i].checked=true;
			}

		}
	</script>
</head>
<body>

<h1>${requestScope.msg1}</h1>
      <table align="center" border="1">
          <tr>
			  <td><input type="checkbox"  class="cb0" onclick="chexkAll()"/></td>
             <td>CPI数据类别</td>
             <td>数据来源区域</td>
             <td>数据来源时间</td>
             <td>商品名称</td>
             <td>价格</td>
             <td>数据单位</td>
             <td>备注信息</td>
             <td>删除信息</td>
             <td>修改信息</td>
           </tr>
        
 <%
	 List<Cpi> list = (List<Cpi>)session.getAttribute("list");
    for(Cpi cpi:list)   {
    	
       
  %>
  	<form id ="form1" method="post">
	    <tr>
			<td><input type="checkbox"  class="cb"/></td>
	       <td>
	       <input type="text" name="dataType" disabled="disabled" value=<%=cpi.getDataType()%> />
	       </td>
	       <td>
	       <input type="text" name="area"  disabled="disabled" value=<%=cpi.getArea() %> />
	       </td>
	       <td>
    	   <input type="text" name="date" disabled="disabled" value=<%=cpi.getDate() %> />
	       </td>
	       <td>
	       <input type="text" name="goodsName" disabled="disabled" value=<%=cpi.getGoodsName()%> />
	       </td>
	       <td>
	       <input type="text" name="price" disabled="disabled" value=<%=cpi.getPrice() %> />
	       </td>
	       <td>
	       <input type="text" name="unit" disabled="disabled" value=<%=cpi.getUnit()%>>
	       </td>
	       <td>
	       <input type="text" name="remark" disabled="disabled" value= <%=cpi.getRemark() %>>
	       </td>
	       <td>
			   <input id="in1" type="button" value="删除" onclick="_submit1()"/>
		   </td>
	       <td>
			   <input id="in2" type="button" value="修改" onclick="_submit2()"/>
		   </td>
	       </tr>
	      </form>
    <%
    }
    %>       
   
        </table>
          
</body>
</html>